import pymysql

# 连接数据库
# 失败返回Error
def db_connect():
    try:
        db = pymysql.connect('127.0.0.1','root','root')
        cursor = db.cursor()
        re = db, cursor
        return re
    except:
        return None